<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<base href='<?php echo base_url()?>'>
<link rel="stylesheet" type="text/css" href="public/common/css/common.css"/>
<link rel="stylesheet" type="text/css" href="public/admin/css/admin.css"/>
<script src="public/common/js/jquery.js"></script>
<script src="public/common/js/plug/wbox/wbox-min.js"></script>
<link rel="stylesheet" type="text/css" href="public/common/js/plug/wbox/wbox/wbox.css">
<script>
$(function(){
	table_show(0);	
	$('.tab ul li').each(function(index){
		$(this).click(function(){
			$('.tab ul li').removeClass('cur');	
			$(this).addClass('cur');
			table_show(index);
		});										  
	});
	$("#image_frame").wBox({
		requestType: "iframe",
		title: "图片管理",
		target:"<?php echo site_url('admin/image/box_show')?>",
		iframeWH:{width:800,height:400}
	});
	$('#product_image').click(function(){
		$('.product_image').show();								   
	});
	$("#product_image").wBox({
		requestType: "iframe",
		title: "图片管理",
		target:"<?php echo site_url('admin/image/box_show/product_image')?>",
		iframeWH:{width:800,height:400}
	});	
});
function table_show(index)
{
	$('.table').hide();
	$('.table:eq('+index+')').show();
}
function delete_product_image(obj)
{
	$(obj).parent().remove();
}
</script>
</head>
<body>
<div class="body">
	<?php echo $this->position->get_position();?>
    <div class="body_center">
   		<div class="tab left">
            <ul>
               	<li class="cur">基本设置</li>
                <li>高级设置</li>
           </ul>
        </div>
        <div class="clear"></div>
    	<form action="<?php echo site_url('admin/product/add_product')?>" method="post">
            <!-- 基本设置 start -->
            <table class="table">
                <tr><th width='20%'>参数名</th><th width='55%'>参数值</th><th width='25%'>参数说明</th></tr>
                <tr>
                    <td align="center">标题：</td>
                    <td><input class="input_txt" type="text" name="product_title" /></td>
                    <td>&nbsp;</td>
                </tr>
                <tr>
                    <td align="center">标志：</td>
                    <td><input type="checkbox" value="1" name="product_zhiding" />置顶 <input type="checkbox" value="1" name="product_tuijian" />推荐</td>
                    <td>&nbsp;</td>
                </tr>
                <tr>
                    <td align="center">来源：</td>
                    <td><input class="input_txt" type="text" name="product_source" value="未知" /></td>
                    <td>&nbsp;</td>
				</tr>
                <tr>
                    <td align="center">作者：</td>
                    <td><input class="input_txt" type="text" name="product_author" value="未知" /></td>
                    <td>&nbsp;</td>
				</tr>
				<tr>
                    <td align="center">缩略图：</td>
                    <td><input id="pic_path" class="input_txt left" type="text" name="product_thumb_image" /> <a id="image_frame" href="<?php echo site_url('admin/image/box_show')?>" class="left">上传图片</a></td>
                    <td id="show_pic_path"><img src="public/common/images/no_pic.gif" width="100px" height="100px"></td>
                </tr>
                <tr>
                    <td align="center">发布栏目：</td>
                    <td>
                    	<select name="category_id">
                        		<?php if($category_tree):?>
                                    <option value="0">- -请选择栏目- -</option>
                                    <?php echo $category_tree;?>
                                <?php else:?>
                                    <option value='0'>没有对应分类</option>
                                <?php endif;?>
                    	</select>
                    </td>
                    <td>&nbsp;</td>
                </tr>
                <tr>
                    <td align="center">产品型号：</td>
                    <td><input class="input_txt" type="text" name="product_attribute[model]" /></td>
                    <td>&nbsp;</td>
                </tr>
                <tr>
                    <td align="center">市场价格：</td>
                    <td><input class="input_txt" type="text" name="product_attribute[market_price]" /></td>
                    <td>&nbsp;</td>
                </tr>
                <tr>
                	<td align="center">详细介绍：</td>
                    <td colspan=2>
                    	<textarea name='product_content' id='ckeditor'></textarea>
						<?php echo display_ckeditor($ckeditor)?>
                    </td>
                </tr>
                <tr>
                    <td align="center">购买说明：</td>
                    <td><textarea name="product_attribute[buy_desc]" class="textarea"></textarea></td>
                    <td>&nbsp;</td>
                </tr>
                <tr>
                    <td align="center">运费：</td>
                    <td><textarea name="product_attribute[shipping]" class="textarea"></textarea></td>
                    <td>&nbsp;</td>
                </tr>
                <tr>
                    <td align="center">交易方式：</td>
                    <td><textarea name="product_attribute[buy_type]" class="textarea"></textarea></td>
                    <td>&nbsp;</td>
                </tr>
                <tr>
                    <td align="center">联系方式：</td>
                    <td><textarea name="product_attribute[contact]" class="textarea"></textarea></td>
                    <td>&nbsp;</td>
                </tr>
                <tr>
                    <td align="center">上传产品图片：</td>
                    <td><a id="product_image" href="<?php echo site_url('admin/image/box_show/product_image')?>" class="left">上传图片</a></td>
                    <td>&nbsp;</td>
                </tr>
                <tr style="display:none;" class="product_image">
                    <td align="center">产品图片：</td>
                    <td colspan="2">
                    	<table><tr></tr></table>
                    </td> 
                </tr>
                <tr>
                    <td align="center" colspan="2">
                   		<input type="submit" class="submit" value="提交" /> 
                        &nbsp;&nbsp;
                        <input type="reset" class="reset" value="重置" />
                    </td>
                    <td>&nbsp;</td>
                </tr>
            </table>
            <!-- 基本设置 end -->
            
            <!-- 高级设置 start -->
            <table class="table">
                <tr><th width='20%'>参数名</th><th width='55%'>参数值</th><th width='25%'>参数说明</th></tr>
                <tr>
                    <td align="center">页面关键字(SEO)：</td>
                    <td><input class="input_txt" type="text" name="product_keywords" /></td>
                    <td><span class="red">*</span> 多个关键字用 | 分开</td>
                </tr>
                <tr>
                    <td align="center">页面描述(SEO)：</td>
                    <td><input class="input_txt" type="text" name="product_desc" /></td>
                    <td><span class="red">*</span> 关键字和描述有助于搜索引擎排名</td>
                </tr>
                <tr>
                    <td align="center">是否新窗口打开：</td>
                    <td><input type="radio" value="1" name="product_new_window" />是 <input type="radio" name="product_new_window" value="0" checked="checked" />否</td>
                    <td><span class="red">*</span> 规定点击之后是在本窗口打开还是新窗口</td>
                </tr>
                <tr>
                    <td align="center" colspan="2">
                   		<input type="submit" class="submit" value="提交" /> 
                        &nbsp;&nbsp;
                        <input type="reset" class="reset" value="重置" />
                    </td>
                    <td>&nbsp;</td>
                </tr>
            </table>
            <!-- 高级设置 end -->
   		</form>
    </div>
</div>
</body>
</html>